﻿using System;
using System.Collections.Generic;
using System.Text;

namespace SimpleSalesTrackingAPIWrapper
{
    public class Notes
    {
        // Get list of all Notes belonging to this company
        public static List<SimpleSalesTrackingAPI.Note> GetNotesByOwner(string username, string password)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return new List<SimpleSalesTrackingAPI.Note>(api.GetNotesByOwner(username, password));
        }

        // Get list of all Notes belonging to the currently authenticated user.
        public static List<SimpleSalesTrackingAPI.Note> GetNotesByUser(string username, string password)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return new List<SimpleSalesTrackingAPI.Note>(api.GetNotesByUser(username, password));
        }

        // Get a single Note, by noteId
        public static SimpleSalesTrackingAPI.Note GetNoteById(string username, string password, int noteId)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.GetNoteById(username, password, noteId);
        }

        // Insert a new Note
        public static int InsertNote(string username, string password, SimpleSalesTrackingAPI.Note note)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.InsertNote(username, password, note);
        }

        // Insert a new Note
        public static int InsertNote(string username, string password, int saleId, string name, string description)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.InsertNote2(username, password, saleId, name, description);
        }

        // Update an existing Note
        public static int UpdateNote(string username, string password, SimpleSalesTrackingAPI.Note note)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.UpdateNote(username, password, note);
        }

        // Update an existing Note
        public static int UpdateNote(string username, string password, int noteId, int saleId, string name, string description)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.UpdateNote2(username, password, noteId, saleId, name, description);
        }

        // Delete an existing Note
        public static int DeleteNote(string username, string password, SimpleSalesTrackingAPI.Note note)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.DeleteNote(username, password, note);
        }

        // Delete an existing Note
        public static int DeleteNote(string username, string password, int noteId)
        {
            SimpleSalesTrackingAPI.API api = new SimpleSalesTrackingAPI.API();
            return api.DeleteNote2(username, password, noteId);
        }
    }
}
